<template>
  <view class="setting-item" @click="$emit('click')">
    <view class="item-left">
      <uni-icons :type="icon" size="20" color="#666"></uni-icons>
      <text class="title">{{ title }}</text>
    </view>
    <uni-icons type="right" size="16" color="#999"></uni-icons>
  </view>
</template>

<script setup>
defineProps({
  title: {
    type: String,
    required: true
  },
  icon: {
    type: String,
    default: 'gear'
  }
})

defineEmits(['click'])
</script>

<style lang="scss">
.setting-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 30rpx;
  border-bottom: 1rpx solid #f5f5f5;
  
  .item-left {
    display: flex;
    align-items: center;
    
    .uni-icons {
      margin-right: 20rpx;
    }
    
    .title {
      font-size: 30rpx;
      color: $text-color;
    }
  }
  
  &:active {
    background-color: #f9f9f9;
  }
}
</style>